extends ../../layout

block content
    .container
        each category in categories
            .panel.panel-default
                .panel-heading.clearfix
                    h3.panel-title.pull-left #{category.name}
                    a.pull-right(href='/category/detail/#{category._id}?page=1') 更多&gt;&gt;
                .panel-body
                    .row
                        each movie in category.movies
                            .col-md-3.text-center
                                a(href='/movie/detail/#{movie._id}')
                                    img(src='#{movie.poster}', alt='#{movie.name}', width='200px', height='300px')
                                    h4 #{movie.name}
        if user && user.role >= 1
            a.btn.btn-default(href='/category/list') category List
            a.btn.btn-default(href='/category/add') category Add
            a.btn.btn-default(href='/movie/list') movie List
            a.btn.btn-default(href='/movie/add') movie Add
            if user && user.role == 2
                a.btn.btn-default(href='/user/list') user List